

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import java.util.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * 
 * @author Al McKenzie
 *
 */
public class testCourse2
{
    List zeb, ted;
    
    Course c;

    @Before
    public void setUp() throws Exception
    {
       
        
        
        zeb = new ArrayList();
        zeb.add("tcss353");
        zeb.add("A");
        zeb.add("java is cool");
        zeb.add("don chin");
        zeb.add("mw");
        zeb.add("450");
        zeb.add("620");
        zeb.add("7");

        ted = new ArrayList();
        ted.add("tcss353");
        ted.add("B");
        ted.add("java is cool");
        ted.add("don chon");
        ted.add("tr");
        ted.add("100");
        ted.add("200");
        ted.add("7");
        
        c =  new Course(zeb);
        c.add(ted);
        
        
        
    }
    
    
    @Test
    public void test()
    {
        //test credits
        assertEquals(7, c.getCredits());
        
        //test instuructor
        assertEquals("don chin", c.getInstructor("A"));
        assertEquals("don chon", c.getInstructor("B"));
        
        //test set sections names
        List<String> cha = new ArrayList<String>();
        cha.addAll(Arrays.asList(c.getSectionNames()));
        assertTrue(cha.contains("A"));
        assertTrue(cha.contains("B"));
        assertTrue(!cha.contains("C"));
        
        //get days
        assertEquals("mw", c.getDays("A"));
        assertEquals("tr", c.getDays("B"));
        
        
        //start time
        assertEquals(450, c.getStartTime("A"));
        assertEquals(100, c.getStartTime("B"));
        
        //end time
        assertEquals(620, c.getEndTime("A"));
        assertEquals(200, c.getEndTime("B"));
        
        //get title
        assertEquals("java is cool", c.getTitle());
        
        //get couseID
        assertEquals("tcss353", c.getId());
        
    }

    @After
    public void tearDown() throws Exception
    {
    }

}
